import http from '@/utils/http'

const BASE_URL = '/cakerun/board'
export interface GeneralCountResp {
  cityName: string
  shopName: string
  shopId: string
  maxBusinessTime: string
  sumCnt: string
  sumDue: string
}
export interface GeneralDailyResp {
  cityName: string
  shopName: string
  shopId: string
  businessTime: string
  cnt: string
  due: string
}
export interface GeneralQuery {
  businessTime: string[]
  accountIds?: string
}
export interface GeneralPageQuery extends GeneralQuery, PageQuery {}

/** @desc 查询美团账号列表 */
export function generalCount(query: GeneralPageQuery) {
  return http.get<GeneralCountResp[]>(`${BASE_URL}/generalCount`, query)
}

/** @desc 查询美团账号列表 */
export function generalDaily(query: GeneralPageQuery) {
  return http.get<GeneralDailyResp[]>(`${BASE_URL}/generalDaily`, query)
}

export function generalDailyExport(query: GeneralQuery) {
  return http.download(`${BASE_URL}/generalDailyExport`, query)
}

export function generalCountExprot(query: GeneralQuery) {
  return http.download(`${BASE_URL}/generalCountExprot`, query)
}

/** @desc 查询美团账号列表 */
export function generalProject(query: GeneralPageQuery) {
  return http.get<GeneralCountResp[]>(`${BASE_URL}/generalProject`, query)
}

export function generalProjectExport(query: GeneralPageQuery) {
  return http.download(`${BASE_URL}/generalProjectExport`, query)
}